Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(types): make U128 a string again #18

Closed
wants to merge 1 commit into from
Closed

Conversation

FranklinWaller
Copy link
Member

Motivation

The overlay node broke because u128 is not supported as a JSON type. It must be a string (added a comment for future references)

Explanation of Changes

Reverted changes to go back to a string instead of a u128

Testing

cargo test works

@FranklinWaller FranklinWaller requested a review from gluax August 19, 2024 15:01
Copy link
Contributor

@gluax gluax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be necessary. AFAIK we've been using this version for a while, and the u128's are serialzed as strings, despite being u128's.

https://github.com/sedaprotocol/seda-common-rs/blob/main/src/msgs/data_requests/types.rs#L132

It looks like the actual problem was I missed adding that in some spots in the one struct :c:

https://github.com/sedaprotocol/seda-common-rs/blob/main/src/msgs/data_requests/types.rs#L66.
and
https://github.com/sedaprotocol/seda-common-rs/blob/main/src/msgs/data_requests/types.rs#L68

All we should need to do is add that line and fix it. Or the better way might be to not alias the type so we don't need to add this line everywhere.

As far as the testing this... that might be hard cause we'd have to enable the cosmwasm feature mid way through a test. Not sure if that's doable but I can look into it.

@FranklinWaller
Copy link
Member Author

FranklinWaller commented Aug 19, 2024

@gluax I'm not sure if that version was pushed to devnet, because staking is broken complaining about the JSON number type.

Checked a bit deeper and its broken. Only serialisation works but deserialisation doesn't.

@FranklinWaller
Copy link
Member Author

Discussed internally with @gluax , we have to implement deserialise conversion of a u128. Closing this PR for now

@FranklinWaller FranklinWaller deleted the ref/u128 branch August 21, 2024 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants